package com.woyou.model.rpc;

import java.util.List;

import retrofit.RetrofitError;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.POST;

import com.woyou.bean.CodeListResult;
import com.woyou.bean.CodeResult;
import com.woyou.bean.MyAddress;
import com.woyou.bean.MyOrderItem;
import com.woyou.bean.Result;
import com.woyou.bean.ShopItem;
import com.woyou.bean.UserInfo;
import com.woyou.bean.rpc.CheckUpdateRes;
import com.woyou.bean.rpc.FeedBackRes;

/**
 * 获取用户信息 Retrofit Service
 * @author tanglc
 */
@SuppressWarnings("rawtypes")
public interface UserService {
	
	/**
	 * 用户登录接口 Login
	 * @param params
	 * @param isEncrypted
	 * @param timeStamp
	 * @param randomNum
	 * @param sign
	 * @return
	 * @throws RetrofitError
	 */
	@FormUrlEncoded
	@POST("/userLogin")
	CodeResult<UserInfo> userLogin(
			@Field("params") String params, 
			@Field("isEncrypted")String isEncrypted, 
			@Field("timeStamp") String timeStamp, 
			@Field("randomNum")String randomNum,
			@Field("sign")String sign)throws RetrofitError;
	
	/**
	 * 更新用户信息接口 updateUserInfo
	 * @param params
	 * @param isEncrypted
	 * @param timeStamp
	 * @param randomNum
	 * @param sign
	 * @return
	 * @throws RetrofitError
	 */
	@FormUrlEncoded
	@POST("/updateUserInfo")
	CodeResult updateUserInfo(
			@Field("params") String params, 
			@Field("isEncrypted")String isEncrypted, 
			@Field("timeStamp") String timeStamp, 
			@Field("randomNum")String randomNum,
			@Field("sign")String sign)throws RetrofitError;
	
	/**
	 * 实时获取用户信息接口 v2_1queryUserInfo
	 * @param params
	 * @param isEncrypted
	 * @param timeStamp
	 * @param randomNum
	 * @param sign
	 * @return
	 * @throws RetrofitError
	 */
	@FormUrlEncoded
	@POST("/v2_1queryUserInfo")
	Result<UserInfo> v2_1queryUserInfo(
			@Field("params") String params, 
			@Field("isEncrypted")String isEncrypted, 
			@Field("timeStamp") String timeStamp, 
			@Field("randomNum")String randomNum,
			@Field("sign")String sign)throws RetrofitError;
	
	/**
	 * 管理我的地址接口 managerAddr
	 * @param params
	 * @param isEncrypted
	 * @param timeStamp
	 * @param randomNum
	 * @param sign
	 * @return
	 * @throws RetrofitError
	 */
	@FormUrlEncoded
	@POST("/managerAddr")
	CodeListResult<MyAddress> managerAddr(
			@Field("params") String params, 
			@Field("isEncrypted")String isEncrypted, 
			@Field("timeStamp") String timeStamp, 
			@Field("randomNum")String randomNum,
			@Field("sign")String sign)throws RetrofitError;
	
	/**
	 * 2.9	查询订单列表（http://xxxx/ v2_1queryMyOrder）
	 * @param params
	 * @param isEncrypted
	 * @param timeStamp
	 * @param randomNum
	 * @param sign
	 * @return
	 * @throws RetrofitError
	 */
	@FormUrlEncoded
	@POST("/v2_3queryMyOrder")
	Result<List<MyOrderItem>> v2_3queryMyOrder(
			@Field("params") String params, 
			@Field("isEncrypted")String isEncrypted, 
			@Field("timeStamp") String timeStamp, 
			@Field("randomNum")String randomNum,
			@Field("sign")String sign)throws RetrofitError;
	
	
	
	/**
	 * 获取验证码接口 getCheckCode
	 * @param params
	 * @param isEncrypted
	 * @param timeStamp
	 * @param randomNum
	 * @param sign
	 * @return
	 * @throws RetrofitError
	 */
	@FormUrlEncoded
	@POST("/getCheckCode")
	CodeResult getCheckCode(
			@Field("params") String params, 
			@Field("isEncrypted")String isEncrypted, 
			@Field("timeStamp") String timeStamp, 
			@Field("randomNum")String randomNum,
			@Field("sign")String sign)throws RetrofitError;
	
	/**
	 * 我的收藏店铺列表接口 myShopList
	 * @param params
	 * @param isEncrypted
	 * @param timeStamp
	 * @param randomNum
	 * @param sign
	 * @return
	 * @throws RetrofitError
	 */
	@FormUrlEncoded
	@POST("/v2_3myShopList")
	Result<List<ShopItem>> v2_3myShopList(
			@Field("params") String params, 
			@Field("isEncrypted")String isEncrypted, 
			@Field("timeStamp") String timeStamp, 
			@Field("randomNum")String randomNum,
			@Field("sign")String sign)throws RetrofitError;
	
	/**
	 * 意见反馈接口 feedback
	 * @param params
	 * @param isEncrypted
	 * @param timeStamp
	 * @param randomNum
	 * @param sign
	 * @return
	 * @throws RetrofitError
	 */
	@FormUrlEncoded
	@POST("/feedback")
	CodeResult<FeedBackRes> feedback(
			@Field("params") String params, 
			@Field("isEncrypted")String isEncrypted, 
			@Field("timeStamp") String timeStamp, 
			@Field("randomNum")String randomNum,
			@Field("sign")String sign)throws RetrofitError;
	
	/**
	 * 2.28	手机信息上传和检查版本更新 checkUpdate
	 * @param params
	 * @param isEncrypted
	 * @param timeStamp
	 * @param randomNum
	 * @param sign
	 * @return
	 * @throws RetrofitError
	 */
	@FormUrlEncoded
	@POST("/checkUpdate")
	CodeResult<CheckUpdateRes> checkUpdate(
			@Field("params") String params, 
			@Field("isEncrypted")String isEncrypted, 
			@Field("timeStamp") String timeStamp, 
			@Field("randomNum")String randomNum,
			@Field("sign")String sign)throws RetrofitError;
	
	/**
	 * 2.29	密码验证接口（http://xxxx/pwdCheck）
	 * @param params
	 * @param isEncrypted
	 * @param timeStamp
	 * @param randomNum
	 * @param sign
	 * @return
	 * @throws RetrofitError
	 */
	@FormUrlEncoded
	@POST("/pwdCheck")
	CodeResult pwdCheck(
			@Field("params") String params, 
			@Field("isEncrypted")String isEncrypted, 
			@Field("timeStamp") String timeStamp, 
			@Field("randomNum")String randomNum,
			@Field("sign")String sign)throws RetrofitError;
	
	
	/**
	 * 2.1版本接口分割线-------------------------------------------------------------------------
	 */
	/**
	 * 意见反馈接口 feedback_v2_1
	 * @param params
	 * @param isEncrypted
	 * @param timeStamp
	 * @param randomNum
	 * @param sign
	 * @return
	 * @throws RetrofitError
	 */
	@FormUrlEncoded
	@POST("/v2_1feedback")
	Result<FeedBackRes> v2_1feedback(
			@Field("params") String params, 
			@Field("isEncrypted")String isEncrypted, 
			@Field("timeStamp") String timeStamp, 
			@Field("randomNum")String randomNum,
			@Field("sign")String sign)throws RetrofitError;
	
	
}
